<div class="row">
  <div class="col-md-1"></div>
  <div class="col-md-4">
    {{#bs-panel}}
      {{single-map lat=model.lat lon=model.lon}}
    {{/bs-panel}}
    {{#bs-panel}}
      {{#if editMode}}
        <h3><span class="glyphicon glyphicon-map-marker"></span> {{t "index.location"}}</h3>
        <dl>
          <dt>{{t "index.street"}}</dt>
          <dd>
             {{input type="text" value=content.street class="form-control"}}
          </dd>
          <dt>{{t "index.number"}}</dt>
          <dd>
             {{input type="text" value=content.number class="form-control"}}
          </dd>
          <dt>{{t "index.city"}}</dt>
          <dd>
             {{input type="text" value=content.city class="form-control"}}
          </dd>
          <dt>{{t "index.zip"}}</dt>
          <dd>
             {{input type="text" value=content.zip class="form-control"}}
          </dd>
        </dl>
        <h3><span class="glyphicon glyphicon-user"></span> {{t "index.contact"}}</h3>
        <dl>
          <dt><span class="glyphicon glyphicon-user"></span> {{t "index.contact_name"}}</dt>
          <dd>
             {{input type="text" value=content.ownername class="form-control"}}
          </dd>
          <dt><span class="glyphicon glyphicon-earphone"></span> {{t "index.contact_phone"}}</dt>
          <dd>
             {{input type="text" value=content.ownerphone class="form-control"}}
          </dd>
          <dt><span class="glyphicon glyphicon-envelope"></span> {{t "index.contact_email"}}</dt>
          <dd>
             {{input type="text" value=content.owneremail class="form-control"}}
          </dd>
        </dl>
        <h3><span class="glyphicon glyphicon-home"></span> {{t "index.info"}}</h3>
        <dl>
          <dt>{{t "index.status"}}</dt>
          <dd>
            <div class="dropdown" style="display: inline-block;">
              <button class="btn btn-default dropdown-toggle" id="publish_dropdown" type="button" data-toggle="dropdown">
                {{statusLabel}}
                <span class="caret"></span>
              </button>
              <ul class="dropdown-menu" role="menu" aria-labelledby="publish_dropdown">
                <li role="presentation">
                  <a role="menuitem" tabindex="-1" href="#" {{action setStatus 0}}>
                     {{t "building.status_suspected"}}
                  </a>
                </li>
                <li role="presentation">
                  <a role="menuitem" tabindex="-1" href="#" {{action setStatus 1}}>
                     {{t "building.status_confirmed"}}
                  </a>
                </li>
                <li role="presentation">
                  <a role="menuitem" tabindex="-1" href="#" {{action setStatus 2}}>
                     {{t "building.status_sold"}}
                  </a>
                </li>
                <li role="presentation">
                  <a role="menuitem" tabindex="-1" href="#" {{action setStatus 3}}>
                     {{t "building.status_for_rent"}}
                  </a>
                </li>
                <li role="presentation">
                  <a role="menuitem" tabindex="-1" href="#" {{action setStatus 4}}>
                     {{t "building.status_rented"}}
                  </a>
                </li>
                <li role="presentation">
                  <a role="menuitem" tabindex="-1" href="#" {{action setStatus 5}}>
                     {{t "building.status_for_sale"}}
                  </a>
                </li>
                <li role="presentation">
                  <a role="menuitem" tabindex="-1" href="#" {{action setStatus 6}}>
                     {{t "building.status_occupied"}}
                  </a>
                </li>
                <li role="presentation">
                  <a role="menuitem" tabindex="-1" href="#" {{action setStatus 7}}>
                     {{t "building.status_tenure"}}
                  </a>
                </li>
                <li role="presentation">
                  <a role="menuitem" tabindex="-1" href="#" {{action setStatus 8}}>
                     {{t "building.status_heritary_tenure"}}
                  </a>
                </li>
              </ul>
            </div>
          </dd>
          <dt>{{t "index.size"}}</dt>
          <dd>
             {{input type="text" value=content.area class="form-control"}}
          </dd>
          <dt>{{t "building.year"}}</dt>
          <dd>
             {{input type="text" value=content.year class="form-control"}}
          </dd>
          <dt>{{t "building.type"}}</dt>
          <dd>
             {{input type="text" value=content.type class="form-control"}}
          </dd>
          <dt>{{t "building.floor"}}</dt>
          <dd>
             {{input type="text" value=content.floor class="form-control"}}
          </dd>
          <dt>{{t "building.condition"}}</dt>
          <dd>
             {{input type="text" value=content.condition class="form-control"}}
          </dd>
          <dt>{{t "building.neighborhood"}}</dt>
          <dd>
             {{#textarea value=content.neighborhood class="form-control"}}{{/textarea}}
          </dd>
          <dt>{{t "index.description"}}</dt>
          <dd>
             {{#textarea value=content.description class="form-control"}}{{/textarea}}
          </dd>
        </dl>
        <h3>{{t "building.whyheading"}}</h3>
        <p>{{t "building.why"}}</p>
        {{#textarea value=content.newcomment class="form-control"}}{{/textarea}}
        {{#bs-button type="default" clicked="leaveEdit"}}
          <span class="glyphicon glyphicon-remove"></span> {{t "building.cancel"}}
        {{/bs-button}}
        {{#bs-button type="default" clicked="executeEdit"}}
          <span class="glyphicon glyphicon-pencil"></span> {{t "building.edit"}} 
        {{/bs-button}}
      {{else}}
        {{#bs-button type="default" clicked="enterEdit"}}
          <span class="glyphicon glyphicon-pencil"></span> {{t "building.edit"}}
        {{/bs-button}}
        <h3><span class="glyphicon glyphicon-map-marker"></span> {{t "index.location"}}</h3>
        <dl>
          <dt>{{t "index.street"}}</dt>
          <dd>
             {{model.street}}
          </dd>
          <dt>{{t "index.number"}}</dt>
          <dd>
             {{model.number}}
          </dd>
          <dt>{{t "index.city"}}</dt>
          <dd>
             {{model.city}}
          </dd>
          <dt>{{t "index.zip"}}</dt>
          <dd>
             {{model.zip}}
          </dd>
        </dl>
        <h3><span class="glyphicon glyphicon-user"></span> {{t "index.contact"}}</h3>
        <dl>
          <dt><span class="glyphicon glyphicon-user"></span> {{t "index.contact_name"}}</dt>
          <dd>
             {{model.ownername}}
          </dd>
          <dt><span class="glyphicon glyphicon-earphone"></span> {{t "index.contact_phone"}}</dt>
          <dd>
             {{model.ownerphone}}
          </dd>
          <dt><span class="glyphicon glyphicon-envelope"></span> {{t "index.contact_email"}}</dt>
          <dd>
             {{model.owneremail}}
          </dd>
        </dl>
        <h3><span class="glyphicon glyphicon-home"></span> {{t "index.info"}}</h3>
        <dl>
          <dt>{{t "index.status"}}</dt>
          <dd>
             {{statusLabel}}
          </dd>
          <dt>{{t "index.size"}}</dt>
          <dd>
             {{model.area}}
          </dd>
          <dt>{{t "index.description"}}</dt>
          <dd>
             {{model.description}}
          </dd>
        </dl>
      {{/if}}
    {{/bs-panel}}
   </div>
   <div class="col-md-6">
    {{#bs-panel}}
      <h2><span class="glyphicon glyphicon-comment"></span> {{t "building.discussion"}}</h2>
      <dl>
        <dt>{{t "building.new_comment"}}</dt>
        <dd>
          {{#textarea value=content.newcomment class="form-control"}}{{/textarea}}<br>
          {{#bs-button clicked="post" type="default"}}
            <span class="glyphicon glyphicon-comment"></span> {{t "building.post"}} 
          {{/bs-button}}<br>
        </dd>
      </dl>
      {{#each comment in reversecomments}}
          {{#if comment.logcomment}}
            <blockquote>
              <h4>
                <span class="glyphicon glyphicon-flash"></span>
                {{comment.user.email}} {{t "building.changed"}} <small>{{fromNow value=comment.date}}</small>
              </h4>
              {{comment.text}}
            </blockquote>
          {{else}}
            <blockquote>
              <h4>
                <span class="glyphicon glyphicon-comment"></span>
                {{t "building.by"}} {{comment.user.email}} <small>{{fromNow value=comment.date}}</small>
              </h4>
              {{comment.text}}
            </blockquote>
          {{/if}}
      {{else}}
        <div class="well"> {{t "building.nothing"}} </div>
      {{/each}}
    {{/bs-panel}}
  </div>
</div>
